Skip to content

feat: add report input to generate a maturity report - #12

Closed
shenxianpeng wants to merge 1 commit into
mainfrom
claude/action-report-option
Closed

feat: add report input to generate a maturity report#12
shenxianpeng wants to merge 1 commit into
mainfrom
claude/action-report-option

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

What

Adds a report input. When set to true, the action generates a human-readable DevOps maturity report and writes it to the GitHub Actions job summary, so it renders right on the workflow run page.

- uses: devops-maturity/devops-maturity-action@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    report: true

The report includes the overall score & level, a per-category breakdown (with a little bar), the met criteria, and the unmet ones with their improvement recommendations.

How

  • New report input, default 'false' — fully backward compatible; existing workflows are unaffected.
  • The assessment step already runs dm config --format json; it now also persists that JSON to $RUNNER_TEMP. A new optional step (if: inputs.report == 'true') reads it and builds the Markdown from the CLI's existing fields (score, level, category_scores, passed, failed) — no extra CLI invocation, no new dependency.
  • New report-path output points at a Markdown copy of the report, written to $RUNNER_TEMP (outside the repo, so it's never committed to the badge PR) for optional artifact upload.
  • README: documented the input/output and added a Reports section with examples (job summary + upload-artifact).

Example output

# DevOps Maturity Report — devops-maturity

**Score:** 79.3%  ·  **Level:** SILVER

## Category breakdown
| Category | Score | |
|---|---:|:--|
| Basics | 100% | `██████████` |
| Quality | 57% | `██████░░░░` |
| Supply Chain Security | 86% | `█████████░` |
...

## Improvement recommendations (2)
- **D405 · SBOM Generation** — Generate an SBOM for each release.
- **D202 · Functional Testing**

Validation

  • action.yml passes the repo's CI check (yaml.safe_load + required keys + composite).
  • The embedded report script py_compiles cleanly and was smoke-tested against a representative dm config --format json payload (output shown above).

🤖 Generated with Claude Code


Generated by Claude Code

When `report: true`, the action renders a human-readable maturity report
(score, level, per-category breakdown, and improvement recommendations)
into the GitHub Actions job summary, so it shows up on the run page.

- New `report` input (default `false`).
- New `report-path` output pointing at a Markdown copy of the report,
  written to RUNNER_TEMP (outside the repo, so it is never committed to
  the badge PR) for optional upload as an artifact.
- Reuses the existing `dm config --format json` output (score, level,
  category_scores, passed/failed) — no extra CLI call beyond persisting
  the JSON the assessment step already produced.
- README: document the input/output and a Reports section with examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants